import { getShopCategory } from '../../api/sysApi/shop'
import Shop from '../../model/shop'
class ShopController {
	static async getShopCategory(ctx) {
		console.log('queryquery', ctx.query)
		ctx.verifyParams({
			cid: { type: 'string', required: true }
		})
		// const res = await listV2({
		// 	page: ctx.query.page,
		// 	size: ctx.query.size,
		// 	shop_id: ctx.query.shop_id,
		// 	access_token: ctx.headers.access_token
		// })
		const res = await getShopCategory({
			cid: ctx.query.cid,
			access_token: ctx.headers.access_token
		})
		ctx.body = res
	}
	static async getShopInfo(ctx) {
		const { shop_id } = ctx.query
		// console.log('queryquery', ctx.query)
		const shopData = await Shop.findOne({ shop_id })
		ctx.body = shopData
	}
}

export default ShopController
